update [$Datatable]
	set  [$indexColumn]=$offset+K.leaf
	from [$temptable] K
	where [$Datatable].[$IndexId]=K.id
